#ifndef SERIALCORE_H
#define SERIALCORE_H

#include <QObject>
#include <QSerialPort>
#include <QVector>
class SerialCore:public QObject
{
    Q_OBJECT
public:
    SerialCore();
    void SetSerialPortInfo(QString Name,int Baudrate,QSerialPort::DataBits,QSerialPort::StopBits,QSerialPort::Parity);
    void Open();
    void Write(QByteArray);
    void Close();
    void Read(int shouldReadLenght,QByteArray&);
    QSerialPort mPort;
    QVector <int> readyReadVector;
    int mSecondTimeOut=1000;
public slots:
    void Slot_ReadyRead();
};

#endif // SERIALCORE_H
